home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
BORL_TIP
/
TI100
/
TI182.ASC
< prev
next >
Wrap
Text File
|
1991-09-11
|
3KB
|
133 lines
PRODUCT : TURBO PASCAL NUMBER : 182
VERSION : ALL
OS : PC-DOS
DATE : March 13, 1986 PAGE : 1/2
TITLE : CURSOR DEFINITION
This sample program demonstrates how to modify the cursor.
program Cursor;
var
ch : char;
Start,
EndCur : integer;
procedure SetCursor(StartLine, Endline : integer);
{ This procedure does the actual cursor setting thru the }
{ Turbo Intr procedure }
type
Registers = record
AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: integer;
end;
var
RegPack : Registers;
CxRegArray : array[1..2] of byte;
CXReg : integer absolute CXRegArray;
begin
CXRegArray[2] := Lo(StartLine);
CXRegArray[1] := Lo(EndLine);
with RegPack do
begin
AX := $0100; {ah = 1 means set cursor type }
BX := $0; {bx = page number, zero for us }
CX := CXReg; {ch bits 4 to 0 = start line for }
{Cursor cl bits 4 to 0 = end line for }
{cursor }
Intr($10, RegPack); {set cursor }
end;
end;
Procedure BoxCursor;
{ This procedure calls SetCursor to show a block (box) cursor }
begin
SetCursor(0, 12);
end; { BoxCursor }
Procedure NoCursor;
{ This procedure calls SetCursor to turn the cursor off }
begin
SetCursor(32, 0);
PRODUCT : TURBO PASCAL NUMBER : 182
VERSION : ALL
OS : PC-DOS
DATE : March 13, 1986 PAGE : 2/2
TITLE : CURSOR DEFINITION
end; { NoCursor }
Procedure ULCursorColor;
{ This procedure calls SetCursor to show the underscore cursor on}
{ a color monitor }
begin
SetCursor(6, 7);
end; { ULCursor }
Procedure ULCursorMono;
{ This procedure calls SetCursor to show the underscore cursor }
{ on a monochrome monitor }
begin
SetCursor(11, 12);
end; { ULCursor }
begin
ClrScr;
write('BOX :'); BoxCursor; readln;
write('NO :'); NoCursor; readln;
write('UL Color :'); ULCursorColor; readln;
write('UL Mono :'); ULCursorMono; readln;
end.